
package me.zhengjie.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author IQW
* @date 2022-07-03
**/
@Entity
@Data
@Table(name="app_event_cate")
public class AppEventCate implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "cate_id")
    @ApiModelProperty(value = "分类ID")
    private Integer cateId;

    @Column(name = "title")
    @ApiModelProperty(value = "名称")
    private String title;

    @Column(name = "img")
    @ApiModelProperty(value = "图片地址")
    private String img;

    @Column(name = "type")
    @ApiModelProperty(value = "1普通事件，2紧急事件")
    private Integer type;

    @Column(name = "ordid")
    @ApiModelProperty(value = "排序（越小越前）")
    private Integer ordid;

    @Column(name = "status")
    @ApiModelProperty(value = "状态")
    private Integer status;

    @Column(name = "create_time")
    @CreationTimestamp
    @ApiModelProperty(value = "创建日期")
    private Timestamp createTime;

    @Column(name = "update_time")
    @UpdateTimestamp
    @ApiModelProperty(value = "更新日期")
    private Timestamp updateTime;

    public void copy(AppEventCate source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}